<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>

    <title>客户下单页面</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"/>

</head>
<body>
<!-- 导航条-->
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
    <a class="navbar-brand" href="#">帮跑小子</a>
    <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarsExample03"
            aria-controls="navbarsExample03" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="navbar-collapse collapse" id="navbarsExample03" style="">
        <ul class="navbar-nav mr-auto">
            <li class="nav-order">
                <a class="nav-link" th:href="@{/order/index}">我要下单 <span class="sr-only">(current)</span></a>
            </li>
            <li class="nav-order active">
                <a class="nav-link" th:href="@{/order/lists}">我的订单</a>
            </li>
        </ul>

    </div>
</nav>


<div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">
    <h1 class="display-4">Pricing</h1>
    <p class="lead">Quickly build an effective pricing table for your potential customers with this Bootstrap example.
        It's built with default Bootstrap components and utilities with little customization.</p>
</div>
<div class="container">
    <div class="row">
        <table class="table">
            <thead>
            <tr>
                <th>订单类型</th>
                <th>收货人姓名</th>
                <th>收货人电话</th>
                <th>送货人姓名</th>
                <th>送货人电话</th>
                <th>帮送/买/取物品</th>
                <th>取货地址</th>
                <th>买货商店</th>
                <th>订单状态</th>

            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <span th:if="${order.type == 1}">帮买</span>
                    <span th:if="${order.type == 2}">帮送</span>
                    <span th:if="${order.type == 3}">帮取</span>
                </td>
                <td th:text="${order.consignee}">#</td>
                <td th:text="${order.consigneeMobile}">#</td>
                <td th:text="${order.consigner}">#</td>
                <td th:text="${order.consignerMobile}">#</td>
                <td th:text="${order.goods}">#</td>
                <td th:text="${order.pickupAddress}">#</td>
                <td th:text="${order.store}">#</td>
                <td>
                    <span th:if="${order.status == 1}">下单成功</span>
                    <span th:if="${order.status == 2}">已指派</span>
                    <span th:if="${order.status == 3}">配送中</span>
                    <span th:if="${order.status == 4}">已送达</span>
                    <span th:if="${order.status == 5}">已收货</span>
                    <span th:if="${order.status == 6}">已评价</span>
                </td>
            </tr>
            </tbody>
        </table>
        <table class="table">
            <thead>
            <tr>
                <th>操作类型</th>
                <th>操作内容</th>
                <th>操作用户</th>
                <th>操作时间</th>
                <th>
                    <span th:if="${order.status == 1}">
                        <a th:href="@{/order/received(id=${order.id})}" type="button" class="btn btn-outline-primary">确定订单</a>
                    </span>
                    <span th:if="${order.status == 5}">
                         <a th:href="@{/order/received(id=${order.id})}" type="button" class="btn btn-outline-primary">评价</a>
                    </span>
                </th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>下单</td>
                <td>下单成功</td>
                <td th:text="${order.creator.nickname}"></td>
                <td th:text="${#dates.format(order.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
            </tr>

            <!--<tr th:if="${order.status >=2}">-->
                <!--<td>指派</td>-->
                <!--<td></td>-->
                <!--<td th:text="${order.creator.nickname}"></td>-->
                <!--<td th:text="${#dates.format(order.receiptTime,'yyyy-MM-dd HH:mm:ss')}"></td>-->
            <!--</tr>-->
            <!--<tr th:if="${order.status >=3}">-->
                <!--<td>配送</td>-->
                <!--<td></td>-->
                <!--<td th:text="${order.creator.nickname}"></td>-->
                <!--<td th:text="${#dates.format(order.receiptTime,'yyyy-MM-dd HH:mm:ss')}"></td>-->
            <!--</tr>-->
            <tr th:if="${order.status >=5}">
                <td>收货</td>
                <td>已收货</td>
                <td th:text="${order.creator.nickname}">#</td>
                <td th:text="${#dates.format(order.deliveryTime,'yyyy-MM-dd HH:mm:ss')}"></td>
            </tr>
            <tr th:if="${order.status >=6}">
                <td>评价</td>
                <td>
                    <span th:text="评价内容 + ': ' + ${order.evaluateContent}"></span>
                </td>
                <td th:text="${order.creator.nickname}">#</td>
                <td th:text="${#dates.format(order.evaluateTime,'yyyy-MM-dd HH:mm:ss')}"></td>
            </tr>


            </tbody>
        </table>
    </div>
    <footer class="pt-4 my-md-5 pt-md-5 border-top">
        <div class="row">
            <div class="col-12 col-md">
                <img class="mb-2" src="https://getbootstrap.com/assets/brand/bootstrap-solid.svg" alt="" width="24"
                     height="24"/>
                <small class="d-block mb-3 text-muted">© 2017-2018</small>
            </div>
            <div class="col-6 col-md">

                <ul class="list-unstyled text-small">
                    <li><a class="text-muted" href="#">Cool stuff</a></li>
                    <li><a class="text-muted" href="#">Random feature</a></li>
                    <li><a class="text-muted" href="#">Team feature</a></li>
                    <li><a class="text-muted" href="#">Stuff for developers</a></li>
                    <li><a class="text-muted" href="#">Another one</a></li>
                    <li><a class="text-muted" href="#">Last time</a></li>
                </ul>
            </div>
            <div class="col-6 col-md">
                <h5>Resources</h5>
                <ul class="list-unstyled text-small">
                    <li><a class="text-muted" href="#">Resource</a></li>
                    <li><a class="text-muted" href="#">Resource name</a></li>
                    <li><a class="text-muted" href="#">Another resource</a></li>
                    <li><a class="text-muted" href="#">Final resource</a></li>
                </ul>
            </div>
            <div class="col-6 col-md">
                <h5>About</h5>
                <ul class="list-unstyled text-small">
                    <li><a class="text-muted" href="#">Team</a></li>
                    <li><a class="text-muted" href="#">Locations</a></li>
                    <li><a class="text-muted" href="#">Privacy</a></li>
                    <li><a class="text-muted" href="#">Terms</a></li>
                </ul>
            </div>
        </div>
    </footer>
</div>


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
</body>
</html>
